/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.spadons.esmetil.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author spadons
 */
@Entity
@Table(name = "tipo_salida")
@NamedQueries({
    @NamedQuery(name = "TipoSalida.findAll", query = "SELECT t FROM TipoSalida t"),
    @NamedQuery(name = "TipoSalida.findByCodigo", query = "SELECT t FROM TipoSalida t WHERE t.codigo = :codigo"),
    @NamedQuery(name = "TipoSalida.findByDesdcripcion", query = "SELECT t FROM TipoSalida t WHERE t.desdcripcion = :desdcripcion")})
public class TipoSalida implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "pulso")
    private boolean pulso;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "codigo")
    private Integer codigo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 60)
    @Column(name = "desdcripcion")
    private String desdcripcion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tipoSalida")
    private List<ModeloSensor> modeloSensorList;

    public TipoSalida() {
    }

    public TipoSalida(Integer codigo) {
        this.codigo = codigo;
    }

    public TipoSalida(Integer codigo, String desdcripcion) {
        this.codigo = codigo;
        this.desdcripcion = desdcripcion;
    }

    public Integer getCodigo() {
        return codigo;
    }

    public void setCodigo(Integer codigo) {
        this.codigo = codigo;
    }

    public String getDesdcripcion() {
        return desdcripcion;
    }

    public void setDesdcripcion(String desdcripcion) {
        this.desdcripcion = desdcripcion;
    }

    public List<ModeloSensor> getModeloSensorList() {
        return modeloSensorList;
    }

    public void setModeloSensorList(List<ModeloSensor> modeloSensorList) {
        this.modeloSensorList = modeloSensorList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigo != null ? codigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoSalida)) {
            return false;
        }
        TipoSalida other = (TipoSalida) object;
        if ((this.codigo == null && other.codigo != null) || (this.codigo != null && !this.codigo.equals(other.codigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.spadons.esmetil.entities.TipoSalida[ codigo=" + codigo + " ]";
    }

    public boolean getPulso() {
        return pulso;
    }

    public void setPulso(boolean pulso) {
        this.pulso = pulso;
    }
    
}
